]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Handle case where keyboardMonitor is unset
authorSam Spilsbury <sam@endlessm.com>
Wed, 11 Oct 2017 10:59:19 +0000 (12:59 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 28 Jun 2018 15:05:29 +0000 (17:05 +0200)
This may be the case where keyboardIndex is -1, which may be the
case where either the keyboard monitor hasn't been set yet, or
the keyboard is being unmanaged and meta_window_get_monitor
returns -1

https://bugzilla.gnome.org/show_bug.cgi?id=788882

js/ui/keyboard.js

index e13c7b72471fd0575856dd5c703336fce5e88171..96da88781c5fdb3aa9ba29f6397c860239838c5a 100644 (file)
@@ -936,9 +936,11 @@ var Keyboard = new Lang.Class({
     },
 
     _relayout() {
-        if (this.actor == null)
-            return;
         let monitor = Main.layoutManager.keyboardMonitor;
+
+        if (this.actor == null || monitor == null)
+            return;
+
         let maxHeight = monitor.height / 3;
         this.actor.width = monitor.width;
         this.actor.height = maxHeight;